import store from './../store';
const haveCol = columnName => {
  let isExist = false;
  const columns = store.getters['d2admin/account/columns'];
  const colPermissionsStr = []
  columns.map(o => {
    colPermissionsStr.push(o.enCode)
    return o
  })
  if (colPermissionsStr === undefined || colPermissionsStr === null) {
    return false;
  }
  if (colPermissionsStr.indexOf(columnName) > -1) {
    isExist = true;
  }
  return isExist;
}
const haveBtn = btnName => {
  let isExist = false;
  const btns = store.getters['d2admin/account/buttons'];
  const btnPermissionsStr = []
  btns.map(o => {
    btnPermissionsStr.push(o.enCode)
    return o
  })
  if (btnPermissionsStr === undefined || btnPermissionsStr === null) {
    return false;
  }
  if (btnPermissionsStr.indexOf(btnName) > -1) {
    isExist = true;
  }
  return isExist;
}
export {
  haveCol, haveBtn
}